package com.tongji;

import android.app.Activity;
import android.os.Bundle;

import com.exception.ProtocolNotSupportedException;
import com.rfb.*;

public class TongjiVNCActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        RfbProtocol rfb = new RfbProtocol();
        boolean bRet = rfb.Connect("10.0.2.2", 5900);
        //boolean bRet = rfb.Connect("ivy-pc", 5900);
        if (bRet) {
            try {
    			rfb.ReadProtocolVersion();
    		} catch (ProtocolNotSupportedException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		}
            rfb.WriteProtocolVersion();
            byte[] types = rfb.ReadSecurityTypes();
            System.out.println(bRet);
            rfb.Close();
		}
    }
}